; Music of Operation Gunship (1989) (Codemasters) (David Whittaker)
; Ripped by Megachur the 18/01/2007

	write "OPERATIG.BIN"

music_date_rip	equ &1217
music_adr	equ &9e7e
first_theme	equ 0
last_theme	equ 4

	read "music_header_v1_0.asm"

;9e7e
;
.init_music	; 0-4
;
	push af
	call la0b9
	pop af
	ld c,a
	add a
	add c
	add a
	add c
	ld c,a
	ld b,#00
	ld hl,la9d4
	add hl,bc
	ld a,(hl)
	ld (l9f5d),a
	ld (la2e4),a
	inc hl
	ld ix,l9edc
	ld c,#22
	ld a,#03
.l9e9f
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	push hl
	ld (ix+#10),#01
	ld (ix+#00),b
	ld (ix+#1d),b
	ld (ix+#1f),b
	ld (ix+#20),b
	ld (ix+#03),e
	ld (ix+#04),d
	ex de,hl
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (ix+#05),#02
	ld (ix+#06),b
	pop hl
	ld (ix+#01),e
	ld (ix+#02),d
	add ix,bc
	dec a
	jr nz,l9e9f
	ld (la23f),a
	dec a
	ld (la2e5),a
	ld (la2df),a
	ret
.l9edc
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#09
.l9efe
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#12
.l9f20
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#24
;
.play_music
;
	ld a,(la2df)
	ld hl,la2e0
	or (hl)
	inc hl
	or (hl)
	inc hl
	or (hl)
	ret z
	call la56f
	ld a,(la2df)
	and a
	jr z,l9fa8
.l9f58 equ $ + 1
	ld a,#00
	ld (l9fa4),a
.l9f5d equ $ + 1
	ld a,#01
	ld hl,la2e5
	add (hl)
	ld (hl),a
	jr nc,l9f7c
	ld b,#00
	ld ix,l9edc
	call la15f
	ld ix,l9efe
	call la15f
	ld ix,l9f20
	call la15f
.l9f7c
	ld ix,l9edc
	call la20c
	ld (la2e6),hl
	ld (la2ee),a
	ld ix,l9efe
	call la20c
	ld (la2e8),hl
	ld (la2ef),a
	ld ix,l9f20
	call la20c
	ld (la2ea),hl
	ld (la2f0),a
.l9fa4 equ $ + 1
	ld a,#00
	ld (la2ec),a
.l9fa8
	ld a,(la2df)
	and a
	jr nz,l9fbe
	ld (la2ee),a
	ld (la2ef),a
	ld (la2f0),a
	ld a,#3f
	ld (la2ed),a
	jr l9fe6
.l9fbe
	ld a,(la2e3)
	and #0f
	xor #0f
	jr z,l9fe6
	ld b,a
	ld a,(la2ee)
	sub b
	jr nc,l9fcf
	xor a
.l9fcf
	ld (la2ee),a
	ld a,(la2ef)
	sub b
	jr nc,l9fd9
	xor a
.l9fd9
	ld (la2ef),a
	ld a,(la2f0)
	sub b
	jr nc,l9fe3
	xor a
.l9fe3
	ld (la2f0),a
.l9fe7 equ $ + 1
.l9fe6
	ld a,#00
	xor #ff
	ld (l9fe7),a
	ld a,(la2e0)
	and a
	jr z,la015
	ld hl,(la2f3)
	ld (la2e6),hl
	ld a,(la97c)
	ld b,a
	bit 3,a
	jr nz,la007
	ld a,(la2f9)
	ld (la2ec),a
.la007
	ld hl,la2ed
	ld a,(hl)
	or #09
	and b
	ld (hl),a
	ld a,(la2fb)
	ld (la2ee),a
.la015
	ld a,(la2e1)
	and a
	jr z,la03f
	ld hl,(la2f5)
	ld (la2e8),hl
	ld a,(la991)
	ld b,a
	bit 3,a
	jr nz,la02f
	ld a,(la2f9)
	ld (la2ec),a
.la02f
	ld hl,la2ed
	ld a,(hl)
	or #12
	rlc b
	and b
	ld (hl),a
	ld a,(la2fc)
	ld (la2ef),a
.la03f
	ld a,(la2e2)
	and a
	jr z,la06b
	ld hl,(la2f7)
	ld (la2ea),hl
	ld a,(la9a6)
	ld b,a
	bit 3,a
	jr nz,la059
	ld a,(la2f9)
.la058 equ $ + 2
	ld (la2ec),a
.la059
	ld hl,la2ed
	ld a,(hl)
	or #24
	rlc b
	rlc b
	and b
	ld (hl),a
	ld a,(la2fd)
	ld (la2f0),a
.la06b
	ld hl,la2f0
	ld d,#0a
.la070
	ld e,(hl)
	ld b,#f4
	out (c),d
	ld bc,#f600
	out (c),c
	ld a,#c0
	out (c),a
	out (c),c
	ld b,#f4
	out (c),e
	ld b,#f6
	add a
	out (c),a
	out (c),c
	dec hl
	dec d
	jp p,la070
	ret
.la091
	ld de,#0a00
.la094
	call la09e
	dec d
	jp p,la094
	ld de,#073f
.la09e
	ld b,#f4
	out (c),d
	ld bc,#f600
	out (c),c
	ld a,#c0
	out (c),a
	out (c),c
	ld b,#f4
	out (c),e
	ld b,#f6
	add a
	out (c),a
	out (c),c
	ret
;
.stop_music
.la0b9
;
	xor a
	ld (la2df),a
	call la0cb
	xor a
	ld (la2ee),a
	ld (la2ef),a
	ld (la2f0),a
	ret
.la0cb
	xor a
	ld (la2e0),a
	ld (la2e1),a
	ld (la2e2),a
	jp la091
	db #00,#00,#00,#00,#00,#00,#00,#12
	db #60,#51,#3c,#00,#00,#6e,#07,#00
	db #71,#00,#4f,#00,#00
	pop hl
	jp la0b9
	ld c,(ix+#05)
	ld b,(ix+#06)
	ld l,(ix+#03)
	ld h,(ix+#04)
	add hl,bc
	inc bc
	inc bc
	ld a,(hl)
	inc hl
	ld d,(hl)
	ld e,a
	or d
	jr nz,la113
	ld l,(ix+#03)
	ld h,(ix+#04)
	ld bc,#0002
	ld e,(hl)
	inc hl
	ld d,(hl)
.la113
	ld (ix+#05),c
	ld (ix+#06),b
	ld b,#00
	jp la16c
	ld a,(ix+#21)
	ld c,a
	and #38
	ld hl,la2aa
	xor (hl)
	and c
	xor (hl)
	ld (hl),a
	xor a
	ld (ix+#1e),a
	jp la16c
	ld a,(de)
	inc de
	ld (la23f),a
	jr la16c
	ld a,(de)
	inc de
	ld (ix+#20),a
	jr la16c
	ld a,(de)
	ld (ix+#1b),a
	inc de
	ld a,(de)
	ld (ix+#1a),a
	ld (ix+#1c),a
	inc de
	ld (ix+#1d),#40
	jr la16c
	set 1,(ix+#00)
	jr la16c
	ld (ix+#1f),#ff
	jr la16c
.la15f
	dec (ix+#10)
	ret nz
	ld (ix+#00),b
	ld e,(ix+#01)
	ld d,(ix+#02)
.la16c
	ld a,(de)
	inc de
	and a
	jp m,la1d9
	ld (ix+#12),a
	bit 0,(ix+#1e)
	jr z,la17e
	ld (l9f58),a
.la17e
	ld l,(ix+#14)
	ld (ix+#16),l
	ld h,(ix+#15)
	ld (ix+#17),h
	ld a,(hl)
	ld (ix+#18),a
	ld (ix+#13),a
	ld a,(ix+#0f)
	ld (ix+#19),a
	set 5,(ix+#00)
	ld a,(ix+#11)
	ld (ix+#10),a
	ld (ix+#02),d
	ld (ix+#01),e
	ld a,(ix+#1f)
	and a
	jr z,la1d8
	ld a,(la2e0)
	and a
	jr z,la1ba
	ld a,(la97c)
	bit 3,a
	jr z,la1d8
.la1ba
	ld a,(la2e1)
	and a
	jr z,la1c7
	ld a,(la991)
	bit 3,a
	jr z,la1d8
.la1c7
	ld a,(la2e2)
	and a
	jr z,la1d4
	ld a,(la9a6)
	bit 3,a
	jr z,la1d8
.la1d4
	ld (ix+#1f),#ff
.la1d8
	ret
.la1d9
	cp #c0
	jr c,la204
	add #20
	jr c,la1e5
	add #10
	jr c,la1ec
.la1e5
	inc a
	ld (ix+#11),a
	jp la16c
.la1ec
	ld hl,la363
	add a
	ld c,a
	add hl,bc
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld (ix+#14),l
	ld (ix+#15),h
	dec hl
	ld a,(hl)
	ld (ix+#0f),a
	jp la16c
.la204
	ld hl,la058
	ld c,a
	add hl,bc
	ld c,(hl)
	add hl,bc
	jp (hl)
.la20c
	ld c,(ix+#00)
	bit 5,c
	jr z,la23e
	ld a,(ix+#19)
	sub #01
	ld (ix+#19),a
	jr nc,la238
	ld a,(ix+#0f)
	ld (ix+#19),a
	ld l,(ix+#16)
	ld h,(ix+#17)
	inc hl
	ld a,(hl)
	and a
	jp m,la238
	ld (ix+#16),l
	ld (ix+#17),h
	ld (ix+#18),a
.la238
	ld a,(ix+#18)
	ld (ix+#13),a
.la23f equ $ + 1
.la23e
	ld a,#00
	add (ix+#12)
	add (ix+#20)
	ld hl,la2e7
	ld d,#00
	add a
	ld e,a
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld l,(ix+#1d)
	bit 6,l
	jr z,la2a0
	ld h,a
	ld b,(ix+#1a)
	sla b
	bit 7,l
	ld a,(ix+#1c)
	jr z,la269
	bit 0,c
	jr nz,la287
.la269
	bit 5,l
	jr nz,la279
	sub (ix+#1b)
	jr nc,la284
	set 5,(ix+#1d)
	sub a
	jr la284
.la279
	add (ix+#1b)
	cp b
	jr c,la284
	res 5,(ix+#1d)
	ld a,b
.la284
	ld (ix+#1c),a
.la287
	ex de,hl
	srl b
	sub b
	ld e,a
	ld a,d
	ld d,#00
	jr nc,la292
	dec d
.la292
	add #a0
	jr c,la29e
.la296
	sla e
	rl d
	add #18
	jr nc,la296
.la29e
	add hl,de
	ex de,hl
.la2a0
	ld a,c
	xor #01
	ld (ix+#00),a
	cpl
	and #03
.la2aa equ $ + 1
	ld a,#38
	jr nz,la2b7
	ld a,(l9f58)
	xor #08
	ld (l9fa4),a
	ld a,#07
.la2b7
	ld hl,la2ed
	xor (hl)
	and (ix+#21)
	xor (hl)
	ld (hl),a
	ld a,(ix+#1f)
	and a
	jp p,la2da
	and #7f
	ld (ix+#1f),a
	ld a,(ix+#21)
	and #38
	xor #ff
	and (hl)
	ld (hl),a
	ld a,#41
	ld (l9fa4),a
.la2da
	ex de,hl
	ld a,(ix+#13)
	ret
.la2e6 equ $ + 7
.la2e5 equ $ + 6
.la2e4 equ $ + 5
.la2e3 equ $ + 4
.la2e2 equ $ + 3
.la2e1 equ $ + 2
.la2e0 equ $ + 1
.la2df
.music_end
	db #00,#00,#00,#00,#0f,#00,#00,#00
.la2ee equ $ + 7
.la2ed equ $ + 6
.la2ec equ $ + 5
.la2ea equ $ + 3
.la2e8 equ $ + 1
.la2e7
	db #00,#00,#00,#00,#00,#00,#3f,#0f
.la2f6 equ $ + 7
.la2f5 equ $ + 6
.la2f4 equ $ + 5
.la2f3 equ $ + 4
.la2f0 equ $ + 1
.la2ef
	db #0f,#0f,#00,#00,#00,#00,#00,#00
.la2fd equ $ + 6
.la2fc equ $ + 5
.la2fb equ $ + 4
.la2f9 equ $ + 2
.la2f8 equ $ + 1
.la2f7
	db #00,#00,#00,#3f,#00,#00,#00,#00
	dw #03be,#0384,#0358,#0320
	dw #02f6,#02ca,#02a2,#027c
	dw #0258,#0238,#0216,#01f8
	dw #01df,#01c2,#01ac,#0190
	dw #017b,#0165,#0151,#013e
	dw #012c,#011c,#010b,#00fc
	dw #00ef,#00e1,#00d6,#00c8
	dw #00bd,#00b2,#00a8,#009f
	dw #0096,#008e,#0085,#007e
	dw #0077,#0070,#006b,#0064
	dw #005e,#0059,#0054,#004f
	dw #004b,#0047,#0042,#003f
	dw #003b,#0038
.la363
	dw la384,la38c,la398,la3aa
	dw la3bc,la3c3,la3ca,la3df
	dw la3e8,la3f9,la40a,la41a
	dw la42b,la43c,la44d,la450
.la384 equ $ + 1
	db #01,#0f,#0d,#0b,#08,#05,#02,#87
.la38c equ $ + 1
	db #01,#0e,#0d,#0b,#09,#07,#05,#04
.la398 equ $ + 5
	db #03,#02,#01,#87,#01,#0f,#0e,#0d
	db #0b,#0d,#0c,#0a,#09,#0b,#0a,#08
.la3aa equ $ + 7
	db #07,#09,#08,#06,#05,#87,#01,#0f
	db #0f,#0d,#0b,#0d,#0c,#0a,#09,#0b
	db #0a,#08,#07,#09,#08,#06,#05,#87
.la3bc equ $ + 1
	db #01,#0f,#0e,#0d,#0c,#0b,#87,#01
.la3ca equ $ + 7
.la3c3
	db #0e,#0d,#0c,#0b,#0a,#87,#01,#0e
	db #0d,#0c,#0b,#0a,#09,#01,#08,#01
	db #07,#01,#06,#01,#05,#01,#04,#01
.la3df equ $ + 4
	db #02,#01,#87,#04,#08,#09,#0a,#0b
.la3e8 equ $ + 5
	db #0c,#0d,#0e,#87,#05,#0f,#0e,#0d
	db #0c,#0b,#0a,#09,#08,#07,#06,#05
.la3f9 equ $ + 6
	db #04,#03,#02,#01,#87,#08,#0f,#0e
	db #0d,#0c,#0b,#0a,#09,#08,#07,#06
.la40a equ $ + 7
	db #05,#04,#03,#02,#01,#87,#04,#0e
	db #0d,#0c,#0b,#0a,#09,#08,#07,#06
.la41a equ $ + 7
	db #05,#04,#03,#02,#01,#87,#04,#0f
	db #0e,#0d,#0c,#0b,#0a,#09,#08,#07
	db #06,#05,#04,#03,#02,#01,#87,#02
.la42b
	db #0f,#0e,#0d,#0c,#0b,#0a,#09,#08
	db #07,#06,#05,#04,#03,#02,#01,#87
.la43c equ $ + 1
	db #01,#0f,#0e,#0d,#0c,#0b,#0a,#09
	db #08,#07,#06,#05,#04,#03,#02,#01
.la450 equ $ + 5
.la44d equ $ + 2
	db #87,#01,#0e,#87,#01,#0f,#87
	ld hl,la45b
	ld b,#00
	add hl,bc
	ld c,(hl)
	add hl,bc
	jp (hl)
.la45b
	inc bc
	ld e,l
	or a
	ld hl,la2e0
	ld (hl),#00
	ld hl,la79b
	add a
	add l
	ld l,a
	jr nc,la46c
	inc h
.la46c
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld b,#0e
	ld hl,la976
.la474
	ld a,(de)
	ld (hl),a
	inc hl
	inc de
	djnz la474
	ld a,(la977)
	ld (la984),a
	ld hl,(la978)
	ld (la2f3),hl
	ld a,(la97c)
	bit 3,a
	jr nz,la491
	ld a,l
	ld (la2f9),a
.la491
	ld a,(la981)
	ld (la985),a
	ld a,(la983)
	ld (la98a),a
	ld a,(la980)
	ld hl,la91b
	add a
	ld c,a
	add hl,bc
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld (la986),hl
	ld (la988),hl
	ld a,(hl)
	ld (la2fb),a
	ld hl,la2e0
	inc (hl)
	ret
	ld hl,la2e1
	ld (hl),#00
	ld hl,la79b
	add a
	add l
	ld l,a
	jr nc,la4c7
	inc h
.la4c7
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld b,#0e
	ld hl,la98b
.la4cf
	ld a,(de)
	ld (hl),a
	inc hl
	inc de
	djnz la4cf
	ld a,(la98c)
	ld (la999),a
	ld hl,(la98d)
	ld (la2f5),hl
	ld a,(la991)
	bit 3,a
	jr nz,la4ec
	ld a,l
	ld (la2f9),a
.la4ec
	ld a,(la996)
	ld (la99a),a
	ld a,(la998)
	ld (la99f),a
	ld a,(la995)
	ld hl,la91b
	add a
	ld c,a
	add hl,bc
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld (la99b),hl
	ld (la99d),hl
	ld a,(hl)
	ld (la2fc),a
	ld hl,la2e1
	inc (hl)
	ret
	ld hl,la2e2
	ld (hl),#00
	ld hl,la79b
	add a
	add l
	ld l,a
	jr nc,la522
	inc h
.la522
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld b,#0e
	ld hl,la9a0
.la52a
	ld a,(de)
	ld (hl),a
	inc hl
	inc de
	djnz la52a
	ld a,(la9a1)
	ld (la9ae),a
	ld hl,(la9a2)
	ld (la2f7),hl
	ld a,(la9a6)
	bit 3,a
	jr nz,la547
	ld a,l
	ld (la2f9),a
.la547
	ld a,(la9ab)
	ld (la9af),a
	ld a,(la9ad)
	ld (la9b4),a
	ld a,(la9aa)
	ld hl,la91b
	add a
	ld c,a
	add hl,bc
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld (la9b0),hl
	ld (la9b2),hl
	ld a,(hl)
	ld (la2fd),a
	ld hl,la2e2
	inc (hl)
	ret
.la56f
	call la9b5
	ld a,(la2e0)
	and a
	call nz,la637
	ld a,(la2e1)
	and a
	call nz,la6e9
	ld a,(la2e2)
	and a
	ret z
	ld a,(la9a0)
	and a
	jr nz,la595
	ld a,(la9ac)
	and a
	jr nz,la595
	ld (la2e2),a
	ret
.la595
	dec a
	ld (la9a0),a
	ld a,(la9ae)
	and a
	jr nz,la5cd
	ld a,(la9ac)
	and a
	jr nz,la5ab
	ld a,(la9a9)
	and a
	jr z,la60f
.la5ab
	dec a
	ld (la9a9),a
	ld a,(la9a1)
	ld (la9ae),a
	ld a,(la9a7)
	and a
	jr z,la5be
	ld a,(la9d2)
.la5be
	ld b,a
	ld a,(la9a2)
	add b
	ld (la2f7),a
	ld a,(la9a3)
	add b
	ld (la2f8),a
.la5cd
	ld hl,la9ae
	dec (hl)
	ld hl,la9ad
	ld a,(hl)
	and a
	jr z,la5df
	ld hl,la9b4
	dec (hl)
	jr nz,la602
	ld (hl),a
.la5df
	ld a,(la9a8)
	and a
	jr z,la602
	jp p,la5f5
	ld hl,(la2f7)
	ld de,(la9a4)
	add hl,de
	ld (la2f7),hl
	jr la602
.la5f5
	ld hl,(la2f7)
	ld de,(la9a4)
	and a
	sbc hl,de
	ld (la2f7),hl
.la602
	ld a,(la9a6)
	bit 3,a
	jr nz,la60f
	ld a,(la2f7)
	ld (la2f9),a
.la60f
	ld a,(la9af)
	dec a
	ld (la9af),a
	jr nz,la636
	ld a,(la9ab)
	ld (la9af),a
	ld hl,(la9b2)
	ld a,(hl)
	inc hl
	and a
	jp p,la630
	cp #80
	jr nz,la636
	ld hl,(la9b0)
	ld a,(hl)
	inc hl
.la630
	ld (la9b2),hl
	ld (la2fd),a
.la636
	ret
.la637
	ld a,(la976)
	and a
	jr nz,la647
	ld a,(la982)
	and a
	jr nz,la647
	ld (la2e0),a
	ret
.la647
	dec a
	ld (la976),a
	ld a,(la984)
	and a
	jr nz,la67f
	ld a,(la982)
	and a
	jr nz,la65d
	ld a,(la97f)
	and a
	jr z,la6c1
.la65d
	dec a
	ld (la97f),a
	ld a,(la977)
	ld (la984),a
	ld a,(la97d)
	and a
	jr z,la670
	ld a,(la9d0)
.la670
	ld b,a
	ld a,(la978)
	add b
	ld (la2f3),a
	ld a,(la979)
	add b
	ld (la2f4),a
.la67f
	ld hl,la984
	dec (hl)
	ld hl,la983
	ld a,(hl)
	and a
	jr z,la691
	ld hl,la98a
	dec (hl)
	jr nz,la6b4
	ld (hl),a
.la691
	ld a,(la97e)
	and a
	jr z,la6b4
	jp p,la6a7
	ld hl,(la2f3)
	ld de,(la97a)
	add hl,de
	ld (la2f3),hl
	jr la6b4
.la6a7
	ld hl,(la2f3)
	ld de,(la97a)
	and a
	sbc hl,de
	ld (la2f3),hl
.la6b4
	ld a,(la97c)
	bit 3,a
	jr nz,la6c1
	ld a,(la2f3)
	ld (la2f9),a
.la6c1
	ld a,(la985)
	dec a
	ld (la985),a
	jr nz,la6e8
	ld a,(la981)
	ld (la985),a
	ld hl,(la988)
	ld a,(hl)
	inc hl
	and a
	jp p,la6e2
	cp #80
	jr nz,la6e8
	ld hl,(la986)
	ld a,(hl)
	inc hl
.la6e2
	ld (la988),hl
	ld (la2fb),a
.la6e8
	ret
.la6e9
	ld a,(la98b)
	and a
	jr nz,la6f9
	ld a,(la997)
	and a
	jr nz,la6f9
	ld (la2e1),a
	ret
.la6f9
	dec a
	ld (la98b),a
	ld a,(la999)
	and a
	jr nz,la731
	ld a,(la997)
	and a
	jr nz,la70f
	ld a,(la994)
	and a
	jr z,la773
.la70f
	dec a
	ld (la994),a
	ld a,(la98c)
	ld (la999),a
	ld a,(la992)
	and a
	jr z,la722
	ld a,(la9d1)
.la722
	ld b,a
	ld a,(la98d)
	add b
	ld (la2f5),a
	ld a,(la98e)
	add b
	ld (la2f6),a
.la731
	ld hl,la999
	dec (hl)
	ld hl,la998
	ld a,(hl)
	and a
	jr z,la743
	ld hl,la99f
	dec (hl)
	jr nz,la766
	ld (hl),a
.la743
	ld a,(la993)
	and a
	jr z,la766
	jp p,la759
	ld hl,(la2f5)
	ld de,(la98f)
	add hl,de
	ld (la2f5),hl
	jr la766
.la759
	ld hl,(la2f5)
	ld de,(la98f)
	and a
	sbc hl,de
	ld (la2f5),hl
.la766
	ld a,(la991)
	bit 3,a
	jr nz,la773
	ld a,(la2f5)
	ld (la2f9),a
.la773
	ld a,(la99a)
	dec a
	ld (la99a),a
	jr nz,la79a
	ld a,(la996)
	ld (la99a),a
	ld hl,(la99d)
	ld a,(hl)
	inc hl
	and a
	jp p,la794
	cp #80
	jr nz,la79a
	ld hl,(la99b)
	ld a,(hl)
	inc hl
.la794
	ld (la99d),hl
	ld (la2fc),a
.la79a
	ret
.la79b
	dw la7cb,la7d9,la7e7,la7f5
	dw la803,la811,la81f,la82d
	dw la83b,la849,la857,la865
	dw la873,la881,la88f,la89d
	dw la8ab,la8b9,la8c7,la8d5
	dw la8e3,la8f1,la8ff,la90d
.la7cb
	db #ff,#00,#07,#00,#00,#00,#f6,#00
.la7d9 equ $ + 6
	db #00,#ff,#04,#01,#ff,#00,#ff,#00
	db #06,#00,#00,#00,#f6,#00,#00,#ff
.la7e7 equ $ + 4
	db #05,#01,#ff,#00,#ff,#00,#04,#00
	db #00,#00,#f6,#00,#00,#ff,#06,#01
.la7f5 equ $ + 2
	db #ff,#00,#46,#07,#32,#02,#03,#00
	db #f7,#01,#ff,#0a,#00,#06,#00,#00
.la803
	db #3c,#09,#1a,#00,#03,#00,#f6,#01
.la811 equ $ + 6
	db #ff,#0a,#01,#06,#00,#00,#32,#0a
	db #0a,#00,#03,#00,#f6,#01,#ff,#0a
.la81f equ $ + 4
	db #02,#04,#00,#00,#96,#ff,#10,#00
	db #01,#00,#fe,#00,#ff,#0a,#02,#05
.la82d equ $ + 2
	db #00,#00,#11,#05,#c7,#00,#20,#00
	db #f6,#00,#ff,#63,#00,#01,#00,#00
.la83b
	db #14,#04,#02,#00,#06,#00,#f7,#01
.la849 equ $ + 6
	db #ff,#63,#08,#02,#00,#00,#19,#19
	db #60,#02,#26,#00,#fe,#00,#ff,#63
.la857 equ $ + 4
	db #07,#63,#08,#00,#0f,#0f,#e0,#00
	db #06,#00,#fe,#00,#01,#63,#07,#63
.la865 equ $ + 2
	db #ff,#00,#14,#05,#c1,#00,#14,#00
	db #f6,#01,#ff,#ff,#00,#02,#00,#00
.la873
	db #02,#05,#08,#00,#00,#00,#f6,#00
.la881 equ $ + 6
	db #01,#63,#09,#01,#00,#00,#1e,#03
	db #8a,#00,#01,#00,#fe,#00,#ff,#ff
.la88f equ $ + 4
	db #08,#03,#00,#00,#1e,#02,#0a,#04
	db #04,#00,#fe,#00,#ff,#ff,#00,#03
.la89d equ $ + 2
	db #00,#00,#02,#05,#09,#00,#00,#00
	db #f7,#00,#01,#63,#09,#01,#00,#00
.la8ab
	db #05,#0f,#0f,#02,#01,#00,#f6,#00
.la8b9 equ $ + 6
	db #01,#00,#08,#01,#00,#00,#0f,#03
	db #21,#03,#14,#00,#fe,#00,#ff,#ff
.la8c7 equ $ + 4
	db #00,#01,#00,#00,#0f,#03,#21,#03
	db #14,#00,#fe,#00,#ff,#ff,#01,#01
.la8d5 equ $ + 2
	db #00,#00,#0f,#03,#21,#03,#14,#00
	db #fe,#00,#ff,#ff,#02,#01,#00,#00
.la8e3
	db #32,#03,#a1,#00,#14,#00,#f6,#00
.la8f1 equ $ + 6
	db #ff,#ff,#00,#04,#00,#00,#3c,#03
	db #04,#00,#02,#00,#f7,#00,#01,#0a
.la8ff equ $ + 4
	db #00,#05,#00,#63,#0f,#63,#f0,#00
	db #21,#00,#fe,#00,#ff,#63,#00,#01
.la90d equ $ + 2
	db #00,#00,#1f,#20,#00,#00,#01,#00
	db #f7,#00,#ff,#05,#00,#0c,#00,#00
.la91b
	dw la92f,la930,la931,la93e
	dw la94f,la955,la95a,la95f
	dw la961,la970
.la931 equ $ + 2
.la930 equ $ + 1
.la92f
	db #0f,#0e,#0d,#0b,#0a,#09,#08,#07
.la93e equ $ + 7
	db #06,#05,#04,#03,#02,#01,#ff,#06
	db #08,#0a,#0b,#0c,#0b,#0a,#09,#08
	db #07,#06,#05,#04,#03,#02,#01,#ff
.la955 equ $ + 6
.la94f
	db #01,#04,#07,#09,#0c,#80,#01,#05
.la95a equ $ + 3
	db #09,#0b,#80,#01,#04,#07,#09,#80
.la961 equ $ + 2
.la95f
	db #0a,#80,#0e,#0d,#0c,#0b,#0a,#09
	db #08,#07,#06,#05,#04,#03,#02,#01
.la976 equ $ + 7
.la970 equ $ + 1
	db #ff,#0e,#01,#0d,#01,#00,#ff,#00
.la97e equ $ + 7
.la97d equ $ + 6
.la97c equ $ + 5
.la97a equ $ + 3
.la979 equ $ + 2
.la978 equ $ + 1
.la977
	db #00,#00,#00,#00,#00,#00,#00,#00
.la986 equ $ + 7
.la985 equ $ + 6
.la984 equ $ + 5
.la983 equ $ + 4
.la982 equ $ + 3
.la981 equ $ + 2
.la980 equ $ + 1
.la97f
	db #00,#00,#00,#00,#00,#00,#00,#00
.la98e equ $ + 7
.la98d equ $ + 6
.la98c equ $ + 5
.la98b equ $ + 4
.la98a equ $ + 3
.la988 equ $ + 1
	db #00,#00,#00,#00,#00,#00,#00,#00
.la996 equ $ + 7
.la995 equ $ + 6
.la994 equ $ + 5
.la993 equ $ + 4
.la992 equ $ + 3
.la991 equ $ + 2
.la98f
	db #00,#00,#00,#00,#00,#00,#00,#00
.la99d equ $ + 6
.la99b equ $ + 4
.la99a equ $ + 3
.la999 equ $ + 2
.la998 equ $ + 1
.la997
	db #00,#00,#00,#00,#00,#00,#00,#00
.la9a6 equ $ + 7
.la9a4 equ $ + 5
.la9a3 equ $ + 4
.la9a2 equ $ + 3
.la9a1 equ $ + 2
.la9a0 equ $ + 1
.la99f
	db #00,#00,#00,#00,#00,#00,#00,#00
.la9ae equ $ + 7
.la9ad equ $ + 6
.la9ac equ $ + 5
.la9ab equ $ + 4
.la9aa equ $ + 3
.la9a9 equ $ + 2
.la9a8 equ $ + 1
.la9a7
	db #00,#00,#00,#00,#00,#00,#00,#00
.la9b4 equ $ + 5
.la9b2 equ $ + 3
.la9b0 equ $ + 1
.la9af
	db #00,#00,#00,#00,#00,#00
.la9b5
	ld a,(la9d0)
	and #48
	adc #38
	sla a
	sla a
	ld hl,la9d3
	rl (hl)
	dec hl
	rl (hl)
	dec hl
	rl (hl)
	dec hl
	rl (hl)
	ld a,(hl)
	ret
.la9d3 equ $ + 3
.la9d2 equ $ + 2
.la9d1 equ $ + 1
.la9d0
	db #ff,#80,#1b,#34
.la9d4
	db #28
	dw laa79,la9f7,laa8d
	db #2c
	dw lac49,lac47,lac4b
	db #24
	dw lac84,lac82,lac86
	db #2a
	dw lacb5,lacb1,lacbb
	db #2a
	dw lad41,lad3d,lad47
.la9f7
	dw laaa1,ladf3,laab3,laab3
	dw laacf,laacf,laab3,laaea
	dw lab05,laacf,laab3,laab3
	dw laacf,laacf,laab3,laaea
	dw lab05,laacf,laaa1,laab3
	dw laacf,lab05,laaf7,laadc
	dw laab3,laacf,lab05,laacf
	dw laab3,laacf,lab05,laaf7
	dw laadc,laab3,laacf,lab05
	dw laacf,ladf9,laab3,laab3
	dw laacf,laacf,laab3,laaea
	dw lab05,laacf,laab3,laacf
	dw lab05,laaf7,laadc,laab3
	dw laacf,lab05,laacf,laab3
	dw laacf,lab05,laaf7,laadc
	dw laab3,laacf,lab05,laacf
	dw #0000
.laa79
	dw lab20,lab34,lab37,lab20
	dw lab82,lab85,lab34,lab82
	dw lab85,#0000
.laa8d
	dw labb4,labc7,labca,labb4
	dw lac15,lac18,labc7,lac15
	dw lac18,#0000
.laaa1
	db #8a,#88,#01,#01,#90,#d4,#e1,#13
	db #e0,#13,#13,#e1,#13,#13,#d9,#e7
.laab3 equ $ + 2
	db #13,#87,#dc,#e1,#0c,#e0,#0c,#0c
	db #e1,#d0,#8d,#0c,#dc,#e0,#0c,#0c
	db #e1,#0c,#e0,#0c,#0c,#e1,#d0,#8d
.laacf equ $ + 6
	db #0c,#dc,#e0,#0c,#0c,#87,#e1,#13
	db #e0,#13,#13,#e1,#d0,#8d,#13,#dc
.laadc equ $ + 3
	db #e0,#13,#13,#e1,#13,#e0,#13,#13
	db #e1,#d0,#8d,#13,#dc,#e0,#13,#13
.laaea equ $ + 1
	db #87,#e1,#15,#e0,#15,#15,#e1,#d0
.laaf7 equ $ + 6
	db #8d,#15,#dc,#e0,#15,#15,#e1,#15
	db #e0,#15,#15,#e1,#d0,#8d,#15,#dc
.lab05 equ $ + 4
	db #e0,#15,#15,#87,#e1,#0e,#e0,#0e
	db #0e,#e1,#d0,#8d,#0e,#dc,#e0,#0e
	db #0e,#e1,#0e,#e0,#0e,#0e,#e1,#d0
.lab20 equ $ + 7
	db #8d,#0e,#dc,#e0,#0e,#0e,#87,#8a
	db #88,#01,#01,#90,#d4,#92,#00,#e1
	db #1a,#e0,#1a,#1a,#e1,#1a,#1a,#d9
.lab37 equ $ + 6
.lab34 equ $ + 3
	db #e7,#1a,#87,#da,#92,#00,#e5,#1f
	db #e0,#1f,#1f,#e1,#1f,#e5,#1c,#e5
	db #1f,#e0,#1f,#1f,#e1,#1f,#e5,#24
	db #e5,#23,#e0,#23,#23,#e1,#23,#e5
	db #1f,#e5,#23,#e0,#23,#23,#e1,#23
	db #e5,#26,#e5,#28,#e0,#28,#28,#e1
	db #28,#e5,#24,#e5,#24,#e0,#24,#24
	db #e1,#24,#e5,#21,#e5,#21,#e0,#21
	db #21,#e1,#21,#e5,#1d,#e5,#21,#e0
	db #21,#21,#e1,#21,#e5,#1f,#92,#0c
.lab85 equ $ + 4
.lab82 equ $ + 1
	db #87,#d4,#92,#00,#e5,#24,#28,#e3
	db #28,#e5,#26,#23,#e3,#24,#e5,#26
	db #28,#e3,#26,#e5,#24,#e0,#26,#24
	db #e7,#23,#e5,#24,#28,#e3,#28,#e5
	db #26,#23,#e3,#24,#e5,#26,#28,#e3
	db #29,#e5,#2b,#e0,#26,#23,#e7,#1f
.labb4 equ $ + 3
	db #92,#0c,#87,#8a,#88,#01,#01,#d4
	db #92,#00,#e1,#1f,#e0,#1f,#1f,#e1
.labc7 equ $ + 6
	db #1f,#1f,#d9,#e7,#1f,#87,#d8,#92
.labca equ $ + 1
	db #00,#e5,#24,#e0,#24,#24,#e1,#24
	db #e5,#1f,#e5,#24,#e0,#24,#24,#e1
	db #24,#e5,#28,#e5,#26,#e0,#26,#26
	db #e1,#26,#e5,#23,#e5,#26,#e0,#26
	db #26,#e1,#26,#e5,#29,#e5,#2b,#e0
	db #2b,#2b,#e1,#2b,#e5,#28,#e5,#28
	db #e0,#28,#28,#e1,#28,#e5,#24,#e5
	db #24,#e0,#24,#24,#e1,#24,#e5,#21
	db #e5,#24,#e0,#24,#24,#e1,#24,#e5
.lac18 equ $ + 7
.lac15 equ $ + 4
	db #23,#92,#0c,#87,#d4,#92,#00,#e5
	db #28,#2b,#e3,#2d,#e5,#2b,#26,#e3
	db #28,#e5,#29,#2b,#e3,#29,#e5,#28
	db #e0,#29,#28,#e7,#26,#e5,#28,#2b
	db #e3,#2d,#e5,#2b,#26,#e3,#28,#e5
	db #29,#2b,#e3,#2d,#e5,#2f,#e0,#2b
	db #26,#e7,#23,#92,#0c,#87
.lac4b equ $ + 4
.lac49 equ $ + 2
.lac47
	dw lac4d,lac5f,lac71
.lac4d
	db #8a,#88,#01,#01,#90,#d4,#e1,#18
	db #e0,#18,#18,#e1,#18,#18,#dc,#e4
.lac5f equ $ + 2
	db #1a,#8e,#8a,#88,#01,#01,#90,#d4
	db #e1,#1b,#e0,#1b,#1b,#e1,#1b,#1b
.lac71 equ $ + 4
	db #dc,#e4,#1f,#8e,#8a,#88,#01,#01
	db #d4,#e1,#1f,#e0,#1f,#1f,#e1,#1f
	db #1f,#dc,#e4,#22,#8e
.lac86 equ $ + 4
.lac84 equ $ + 2
.lac82
	dw lac88,lac96,laca4
.lac88
	db #8a,#88,#01,#01,#90,#d4,#e0,#1f
.lac96 equ $ + 6
	db #1f,#1f,#d8,#eb,#20,#8e,#8a,#88
	db #01,#01,#90,#d4,#e0,#24,#24,#24
.laca4 equ $ + 4
	db #d8,#eb,#24,#8e,#8a,#88,#01,#01
	db #d4,#e0,#28,#28,#28,#d8,#eb,#27
	db #8e
.lacb5 equ $ + 4
.lacb1
	dw lacd5,#0000,laced,lacf4
.lacbb equ $ + 2
	dw #0000,lad15,lad1c,ladf6
	dw lad15,lad1c,ladf9,lad15
	dw lad1c,ladfc,lad15,lad1c
	dw ladf3,#0000
.lacd5
	db #8a,#88,#01,#01,#90,#d3,#e3,#13
	db #13,#13,#13,#13,#13,#13,#13,#0e
	db #0e,#0e,#0e,#0e,#0e,#0e,#0e,#87
.lacf4 equ $ + 7
.laced
	db #8a,#88,#01,#01,#90,#92,#f4,#d5
	db #e5,#26,#e0,#26,#26,#e1,#26,#e3
	db #2b,#e1,#26,#ef,#d8,#26,#d5,#e5
	db #26,#e0,#26,#26,#e1,#26,#e3,#2d
	db #e1,#26,#ef,#d8,#26,#92,#00,#87
.lad1c equ $ + 7
.lad15
	db #8a,#88,#01,#01,#90,#92,#f4,#d4
	db #e5,#2b,#e0,#2b,#2b,#e1,#2b,#e3
	db #32,#e1,#2b,#ef,#d9,#2b,#d4,#e5
	db #2d,#e0,#2d,#2d,#e1,#2d,#e3,#32
	db #e1,#2d,#ef,#d9,#2d,#92,#00,#87
.lad41 equ $ + 4
.lad3d
	dw lad61,#0000,lad8d,lad95
.lad47 equ $ + 2
	dw #0000,ladc0,ladc8,ladf6
	dw ladc0,ladc8,ladf9,ladc0
	dw ladc8,ladfc,ladc0,ladc8
	dw ladf3,#0000
.lad61
	db #8a,#88,#01,#01,#90,#d3,#e0,#0d
	db #0d,#e3,#12,#12,#12,#12,#12,#12
	db #12,#12,#12,#12,#12,#12,#12,#12
	db #12,#12,#0d,#0d,#0d,#0d,#0d,#0d
	db #0d,#0d,#0d,#0d,#0d,#0d,#0d,#0d
.lad8d equ $ + 4
	db #0d,#e1,#0d,#87,#8a,#88,#01,#01
.lad95 equ $ + 4
	db #90,#d4,#92,#00,#e0,#19,#19,#ed
	db #1e,#e0,#1e,#1e,#ed,#22,#e0,#22
	db #22,#ed,#25,#e0,#25,#25,#ed,#2a
	db #e0,#2a,#2a,#ed,#29,#e0,#29,#29
	db #ed,#25,#e0,#25,#25,#ed,#20,#e0
.ladc0 equ $ + 7
	db #20,#20,#ed,#1d,#92,#0c,#87,#8a
.ladc8 equ $ + 7
	db #88,#01,#01,#90,#d4,#92,#00,#e0
	db #1e,#1e,#ed,#22,#e0,#22,#22,#ed
	db #25,#e0,#25,#25,#ed,#2a,#e0,#2a
	db #2a,#ed,#2e,#e0,#2e,#2e,#ed,#2c
	db #e0,#2c,#2c,#ed,#29,#e0,#29,#29
	db #ed,#25,#e0,#25,#25,#ed,#20,#92
.ladf6 equ $ + 5
.ladf3 equ $ + 2
	db #0c,#87,#89,#00,#87,#89,#01,#87
.ladfc equ $ + 3
.ladf9
	db #89,#02,#87,#89,#03,#87

.game_name
	db "Operation Gunship",0
.game_year
	db "1989",0
.game_publisher
	db "Codemasters",0
.music_author
	db "David Whittaker",0
.music_comment
	db "",0
	
	read "music_end_v1_0.asm"
